﻿using Windows.UI.Notifications;
using Windows.UI.StartScreen;

namespace SeriesManager.Core
{
    public static class TileManager
    {
        public static void UpdateTile(int id, int count)
        {
            if (SecondaryTile.Exists(id.ToString()))
            {
                var badgeDOM = new Windows.Data.Xml.Dom.XmlDocument();
                badgeDOM.LoadXml("<badge value='" + count + "'/>");
                BadgeNotification badge = new BadgeNotification(badgeDOM);
                BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(id.ToString()).Update(badge);
            }
        }
    }
}
